﻿using System.Windows.Controls;
using System.Windows.Media;

namespace Ree7.TileToolkit.TileTemplates
{
    /// <summary>
    /// This tile template is designed to be a pixel perfect copy of WP7's native tiles with counters
    /// </summary>
    public partial class MediumCountTileTemplate : UserControl
    {
        public MediumCountTileTemplate()
        {
            InitializeComponent();
            
            // Default values
            Title = "";
            Count = "";
            Background = null;
            Icon = null;
        }

        /// <summary>
        /// You can set any kind of brush as the background (Image, Gradient, SolidColor)
        /// or just do not set the property to leave it transparent (and use the phone theme color)
        /// </summary>
        public new Brush Background
        {
            get
            {
                return LayoutRoot.Background;
            }
            set
            {
                LayoutRoot.Background = value;
            }
        }

        /// <summary>
        /// The icon that stands in the center of the tile, next to the count index
        /// </summary>
        public ImageSource Icon
        {
            get
            {
                return TileIcon.Source;
            }
            set
            {
                TileIcon.Source = value;
            }
        }

        /// <summary>
        /// The text appearing in the lower left corner of the tile typically used for the application name
        /// </summary>
        public string Title
        {
            get
            {
                return TileAppName.Text;
            }
            set
            {
                TileAppName.Text = value;
            }
        }

        /// <summary>
        /// The count index (usually a number) that appears next to the Icon
        /// </summary>
        public string Count
        {
            get
            {
                return TileCount.Text;
            }
            set
            {
                TileCount.Text = value;
            }
        }
    }
}
